package com.fansl.allround.common.core.constant.enums;

import lombok.Getter;

/**
 * @author fansl
 * @Description: 认证类型
 * @date 2019/9/25 11:24
 */
@Getter
public enum OauthTypeEnum {
    PASSWORD(0,"密码"),
    PHONE(1,"手机"),
    WECHAT(2,"微信"),
    QQ(3,"qq"),
    WEIBO(4,"微博"),
    EMAIL(5,"邮箱"),
    ;
    private final int code;

    private final String message;

    OauthTypeEnum(int code, String message){
        this.code = code;
        this.message = message;
    }

    public static OauthTypeEnum getByCode(int code){
        for (OauthTypeEnum value:OauthTypeEnum.values()){
            if (value.code==code){
                return value;
            }
        }
        return PASSWORD;
    }
}
